package org.keqinglee.study.system;

import java.util.concurrent.TimeUnit;

/**
 * @description: org.keqinglee.study.system
 * @author: keqinglee
 * @date: 2022/8/30
 */
public class SystemOut {

    /**
     * 利用\r实现进度条
     * \r回车，会把光标移动到行首
     *
     * @param args
     */
    public static void main(String[] args) {
        for (int i = 1; i <= 100; i++) {
            System.out.print("\r" + i + "%");
            try {
                TimeUnit.MILLISECONDS.sleep(100);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }

}
